<?php
namespace Topxia\Service\Kuke\Impl;

use Topxia\Common\ArrayToolkit;
use Topxia\Service\Common\BaseService;
use Topxia\Service\Kuke\LearningCardService;

class LearningCardServiceImpl extends BaseService implements LearningCardService
{	
    //后台获取学习卡的批次
    public function getBatch()
    {
        return $this->getLearningCardDao()->getBatch();
    }
	//获取学习卡信息
    public function get($start, $limit,$sbatch)
    {
        return $this->getLearningCardDao()->get($start, $limit,$sbatch);
    } 
	
	public function getcm($cardid)
    {
        return $this->getLearningCardDao()->getcm($cardid);
    }
    //获取学习卡总数
    public function total()
    {
    	return $this->getLearningCardDao()->total();
    }
    public function total1($conditions)
    {
        return $this->getLearningCardDao()->total1($conditions);
    }
    //生成学习卡
  public function buildding($conditions)
	{
		return $this->getLearningCardDao()->buildding($conditions);
	}
	//删除学习卡
	public function delete($id)
	{
		return $this->getLearningCardDao()->delete($id);
	}
	//获取总数
	public function getCardCount($conditions)
	{
		return $this->getLearningCardDao()->getCardCount($conditions);	
	}
	//更新学习卡状态
	public function updateStatus($status,$id,$userId,$rechargetime)
	{
		return $this->getLearningCardDao()->updateStatus($status,$id,$userId,$rechargetime);
	}

    //学习卡批次的查询
    public function search($conditions,$start, $limit)
    {
        return $this->getLearningCardDao()->search($conditions,$start, $limit);
    }
    //学习卡卡号的查询
    public function searchId($conditions,$start, $limit)
    {
        return $this->getLearningCardDao()->searchId($conditions,$start, $limit);
    }


    //获取学习卡的批次
    public function getMaxBatch()
    {
        return $this->getLearningCardDao()->getMaxBatch();
    }
    //前台对学习卡状态的查询
    public function select($cardId)
    {
        return $this->getLearningCardDao()->select($cardId);
    }

    //通过用户的id获取该用户所有的学习卡信息
    public function getCard($uid,$start,$limit)
    {
        return $this->getLearningCardDao()->getCard($uid,$start,$limit);
    } 
	//API调用接口列表
	public function getmeCard($userId)
    {
        return $this->getLearningCardDao()->getmeCard($userId);
    }

    //订单页面查询相应的学习卡
    public function getOrderCard($data)
    {
        return $this->getLearningCardDao()->getOrderCard($data);
    }
    //订单页面获取相应的classroom学习卡
    public function getRoomCard($info)
    {
        return $this->getLearningCardDao()->getRoomCard($info);
    }

    //订单页面获取已经选定的学习卡的信息
    public function selectId($id)
    {
        return $this->getLearningCardDao()->selectId($id);
    }
    //生成订单后更改学习卡的面额
    public function updateMoney($id,$diff)
    {
        return $this->getLearningCardDao()->updateMoney($id,$diff);
    }
    //提交订单之后修改学习卡状态
    public function upStatus($status,$id)
    {
        return $this->getLearningCardDao()->upStatus($status,$id);
    }

    //按批次导出excel格式
    public function selectBatch($batch,$limit)
    {
        return $this->getLearningCardDao()->selectBatch($batch,$limit);
    }
    //导出学习卡的字段名
    public function selectFields()
    {
        return $this->getLearningCardDao()->selectFields();
    }
    //获得已经生成的学习卡的总量
    public function getNum()
    {
        return $this->getLearningCardDao()->getNum();
    }

    //获得已经充值的学习卡的数量
    public function  getCnum($nbatch)
    {
        return $this->getLearningCardDao()->getCnum($nbatch);
    }
     public function getNoNum($nbatch)
     {
        return $this->getLearningCardDao()->getNoNum($nbatch);
     }

     public function getInfo()
     {
        return $this->getLearningCardDao()->getInfo();
     }
    //获得总共已有多少学习卡已经充值
    public function getCzNum()
    {
        return $this->getLearningCardDao()->getCzNum();
    }
    protected function getLearningCardDao()
    {
        return $this->createDao('Kuke.LearningCardDao');
    }
}
